/*
 * Copyright (C) 2009 AnK Team
 *	 Andrey Korolev
 *	 Anna Krel
 *	 Anna Kapanina
 *	 
 *	 http://code.google.com/p/ankfood/	
 *    
     
 *    Licensed under the GNU General Public License, Version 2.0 (the "License");
 *
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *         http://www.gnu.org/licenses/gpl-2.0.html

 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,

 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */



package org.ank.food;

import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;

public class LicenceActivity extends Activity{
	
	private Button acceptButton;
		
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.licence_activity);
        setTitle(getString(R.string.app_name)+" - "+getString(R.string.licence));
        acceptButton = (Button)findViewById(R.id.licence_accept_button);
        acceptButton.setOnClickListener(new Button.OnClickListener(){
			public void onClick(View arg0) {
//				Log.v("license", "license accepted");
				setResult(RESULT_OK);
				finish();
			}
        });
	}
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if (keyCode == KeyEvent.KEYCODE_BACK) {
			setResult(RESULT_CANCELED);
//			Log.v("license", "license declined");
			finish();
			return true;
		}
	    return super.onKeyDown(keyCode, event);
	}

}
